package com.woniuxy.oldmanapi.mapper;

import com.woniuxy.oldmanapi.cvo.CareCareprojectVo;
import com.woniuxy.oldmanapi.cvo.CareVo;
import com.woniuxy.oldmanapi.entity.CareCareproject;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@Repository
public interface CareCareprojectMapper extends Mapper<CareCareproject> {
    @Select("select DISTINCT cc.care_id from care_careproject cc INNER JOIN careproject c on cc.careProject_id=c.id where c.careType_id=#{typeid}")
    List<Integer> selectByTypeId(int typeid);

    void removeBeachByCareids(@Param("list") List<Integer> careIds);

    @Select("select DISTINCT care_id from care_careproject where careproject_id=#{id}")
    List<Integer> selectByCareprojectId(int id);

    List<CareCareprojectVo> selectByCareId(int id);
    @Delete("delete from care_careproject where care_id=#{id}" )
    void removeByCareid(int id);

    void insertBeach(@Param("careId") Integer careId,@Param("list") List<CareCareprojectVo> careCareprojectVos);

    CareVo selectcardvoByCid(int careId);
}
